package com.hopes.bizz.risk.transfer.converter;

import com.hopes.bizz.risk.control.entity.RiskMeasureTaskRecordEntity;
import com.hopes.bizz.risk.transfer.bean.dto.RiskMeasuresTaskRecordDto;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface RiskMeasuresTaskRecordConverter {

    RiskMeasuresTaskRecordConverter INSTANCE = Mappers.getMapper(RiskMeasuresTaskRecordConverter.class);

    @Mapping(target = "uid", source = "id")
    @Mapping(target = "createBy", source = "createBy")
    @Mapping(target = "taskHandleTime", source = "checkTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "mobileMe", source = "mobileMe")
    @Mapping(target = "defendFlag", source = "isDefend")
    @BeanMapping(ignoreByDefault = true)
    RiskMeasureTaskRecordEntity toEntity(RiskMeasuresTaskRecordDto riskMeasuresTaskRecordDto);
}
